/**********************************************************************/
#ifndef CHATSERVER_H
#define CHATSERVER_H

/**********************************************************************/
#include <QTcpServer>
#include "chatclient.h"

/**********************************************************************/
class ChatServer : public QTcpServer
{
  Q_OBJECT;

  public:
    ChatServer();

  private slots:
    void start(quint16);
    void stop();
    void distributeData(ChatClient *);
    void forwardError(QString);
    void checkData(ChatClient *, QByteArray);
    void printToProtocol(char *, QString);

  private:
    QList<ChatClient *> clientList;

  protected:
    void incomingConnection(int);

  signals:
    void error(QString);
    void protocolMessage(QString);
    void statusMessage(QString);
    void clientAdded(QString);
};

/**********************************************************************/
#endif // CHATSERVER_H
